package com.itheima.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class JdbcDemo01 {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/db6", "root", "root");
        Statement sta = con.createStatement();
        /*String sql = "SELECT * FROM student";
        ResultSet res = sta.executeQuery(sql);
        while(res.next()){
            System.out.println(res.getInt("id")+","+res.getString("name")+","+res.getInt("age")
            +","+res.getString("gender")+","+res.getInt("score"));
        }*/
        String sql = "delete from student where name='张三'";
        long res = sta.executeLargeUpdate(sql);
        System.out.println(res);
        //res.close();
        sta.close();
        con.close();
    }
}
